package com.heying.springcore.aop.jdbc;

import com.heying.springcore.SpringConfig;
import com.heying.springcore.aop.jdbc.entity.ClassInfo;
import com.heying.springcore.aop.jdbc.entity.Customer;
import com.heying.springcore.aop.jdbc.entity.StudentInfo;
import com.heying.springcore.aop.jdbc.service.ClassService;
import com.heying.springcore.aop.jdbc.service.CustomerService;
import com.heying.springcore.aop.jdbc.service.StudentService;
import com.heying.springcore.javaconfig.Student;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import javax.xml.crypto.Data;
import java.util.Date;

public class TestSpring {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext context =
                new AnnotationConfigApplicationContext(SpringConfig.class);
//        StudentService studentService = context.getBean(StudentService.class);
//        studentService.insertOne(new StudentInfo("6666", "ttt", new Date(), 0,
//                "bbb", "123456789"));
//        System.out.println(studentService.queryStuAndClassByStuno("05001"));

//        ClassService classService = context.getBean(ClassService.class);
//        classService.insertOne(new ClassInfo("33","微积分"));
        CustomerService customerService = context.getBean(CustomerService.class);
        System.out.println(customerService.queryByCustomer("1002"));

    }
}
